var async=require('async');
var h=require('./helper');

//重试

var time=Date.now(),now;
async.retry({times:10,interval:1000}, function (cb) {
    now=Date.now();
    console.log('interval:',now-time);
    time=now;
    var mt=Math.random();
    console.log(mt);
    if(mt>0.3){
        cb('Error(阈值大于0.3)');
    }else{
        cb(null,Date.now());
    }
}, function (err, result) {
    console.log('err:',err);
    console.log('result:',result);
});